<!-- 菜单列表-->
{extend name="common/block" /}
{block name="content"}

<div class="layui-btn-container " style="display: inline-block;">
    {if array_key_exists('delete',$menu_buttons)}
    <button id="btnDeleteChecked" class="layui-btn layui-btn-sm layui-btn-danger" j-href="{:url($menu_buttons.delete.link)}">
        <i class="layui-icon">{if !empty($menu_buttons.delete.icon)}{php}echo $menu_buttons['delete']['icon'];{/php}{else/}&#xe640;{/if}</i>{$menu_buttons.delete.name}
    </button>
    {/if}
    {if isset($menu_buttons.create)}
    <button class="layui-btn layui-btn-sm j-open"
            j-href="{:url($menu_buttons.create.link)}"
            j-title="{$menu_buttons.create.name}"
            j-type="2"
            j-config='{"area":["80%","80%"],"anim":2}'
    >
        <i class="layui-icon">{if !empty($menu_buttons.create.icon)}{php}echo $menu_buttons['create']['icon'];{/php}{else/}&#xe640;{/if}</i>{$menu_buttons.create.name}
    </button>
    {/if}
    <button id="btnExpandAll" class="layui-btn layui-btn-sm layui-btn-primary">
        <i class="layui-icon layui-icon-spread-left"></i>展开
    </button>
    <!--<button id="btnFoldAll" class="layui-btn layui-btn-sm layui-btn-primary ">
        <i class="layui-icon">&#xe66b;</i>折叠
    </button>-->

</div>
{if isset($menu_buttons.search)}
<div class="j-right">
    <input class="layui-input" id="edtSearch" value="" placeholder="输入关键字,菜单名等"
           style="display: inline-block;width: 140px;height: 30px;line-height: 30px;padding: 0 5px;margin-right: 5px;"/>
    <div class="layui-btn-container" style="display: inline-block;">
        <button id="btnSearch" class="layui-btn layui-btn-sm layui-btn-primary">
            <i class="layui-icon">&#xe615;</i>搜索
        </button>
        <button id="btnClearSearch" class="layui-btn layui-btn-sm layui-btn-primary">
            <i class="layui-icon">&#x1006;</i>清除搜索
        </button>
    </div>
</div>
{/if}

<script type="text/html" id="opera">
    {if isset($menu_buttons.update)}
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">{$menu_buttons.update.name}</a>
    {/if}
    {if isset($menu_buttons.delete)}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{$menu_buttons.delete.name}</a>
    {/if}
</script>
    <table id="table" lay-filter="menu"></table>

{/block}

{block name="loadJs"}
<script src="__ADMIN__/menu/index.js"></script>
{/block}